const mongoose = require('mongoose');

const { Classify } = require('../../model/classify');

module.exports = async (req, res) => {
    var { _id, name } = req.fields
    // console.log(req.fields);
    try {
        var data = await Classify.updateOne({ _id }, { name })
        // console.log(data);
    } catch(err) {
        return res.send({
            data: null,
            meta: {
                status: 403,
                msg: '修改失败'
            }
        })
    }
    res.send({
        data: null,
        meta: {
            status: 203,
            msg: '修改成功'
        }
    })
}